package com.konsung.ksdc.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/5/16 0016.
 * 地址bean类
 */
public class AddrAdvanceBean implements Parcelable {
    private ArrayList<AddrBaseBean> aearList;
    private String areaId; //地区id
    private String areaName; //地区名称

    /**
     * 序列化构造
     * @param in 序列化
     */
    protected AddrAdvanceBean(Parcel in) {
        aearList = in.createTypedArrayList(AddrBaseBean.CREATOR);
        areaId = in.readString();
        areaName = in.readString();
    }

    public static final Creator<AddrAdvanceBean> CREATOR = new Creator<AddrAdvanceBean>() {
        @Override
        public AddrAdvanceBean createFromParcel(Parcel in) {
            return new AddrAdvanceBean(in);
        }

        @Override
        public AddrAdvanceBean[] newArray(int size) {
            return new AddrAdvanceBean[size];
        }
    };

    /**
     * 得到地区的集合
     * @return 集合
     */
    public ArrayList<AddrBaseBean> getAearList() {
        return aearList;
    }

    /**
     * 设置地区的集合
     * @param  aearList 数据集合
     */
    public void setAearList(ArrayList<AddrBaseBean> aearList) {
        this.aearList = aearList;
    }

    /**
     * 获取地区id
     * @return 地区id
     */
    public String getAreaId() {
        return areaId;
    }

    /**
     * 设置id
     * @param areaId  地区id
     */
    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }
    /**
     * 获取地区名称
     * @return 地区名称
     */
    public String getAreaName() {
        return areaName;
    }
    /**
     * 设置地区名称
     * @param  areaName 地区名称
     */
    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    /**
     * 构造方法
     */
    public AddrAdvanceBean() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList(aearList);
        dest.writeString(areaId);
        dest.writeString(areaName);
    }
}
